package tjs.study.notes.dotest.jvm.step;

/**
 * Created by Nicky.Tang on 2021/10/23 9:35 上午
 *
 * @since 02.12.10
 */
public class StaticSon extends StaticParent {//父类会马上尝试加载
    public static int before_1 = 2;
    public static Integer before_2 = 2;//因为准备阶段给的是null，初始阶段又要等父类加载完，所以NullPointerException
    private StaticParent staticParent;//成员属性引用的类不会马上加载

    {
        System.out.println("我每次被实例化的时候才执行：");
    }

    static {
        System.out.println("类被加载的时候就执行：");
    }
}
